package edu.lmu.cs.dhara.roflkode.entities;

import edu.lmu.cs.dhara.util.Log;

/**
 * The roflkode PLZ statement.
 */
public class TryStatement extends Statement {
    private Statement statementToTry;
    private Block success;
    private Block failure;

    /**
     * Create a switch statement with a complete list of cases.
     */
    public TryStatement(Statement s, Block success, Block failure) {
    	this.statementToTry = s;
        this.success = success;
        this.failure = failure;
    }
    
    /**
     * Returns the simple statement.
     */
    public Statement getTryStatement() {
    	return statementToTry;
    }
    
    /**
     * Returns the success block.
     */
    public Block getSuccessBlock() {
    	return success;
    }
    
    /**
     * Returns the failure block.
     */
    public Block getFailureBlock() {
    	return failure;
    }

    /**
     * Analyzes the try statement (by analyzing each case).
     */
    public void analyze(Log log, SymbolTable table, Function f, boolean inLoop) {
//        for (Case c: cases) {
//            c.analyze(log, table, f, inLoop);
//        }
    }
}
